Skip to content

[rush] Expose hasUncommittedChanges flag on input snapshot #5222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 7, 2025

Conversation

dmichon-msft
Copy link
Contributor

Summary

Adds a flag hasUncommittedChanges to the metadata for the input snapshot that plugins can use to identify if the current repository state has uncommitted changes. This is useful if trying to tie state to a git commit.

Details

Adds getDetailedRepoStateAsync API to @rushstack/package-deps-hash to expose hasUncommittedChanges and hasSubmodules in addition to the existing files map. The information to compute these fields was already available in the calculation of getRepoStateAsync.

Updates getRepoStateAsync to just be a wrapper around getDetailedRepoStateAsync that extracts and returns the files property.

How it was tested

Updated the existing unit tests for getRepoStateAsync to instead operate on the expanded data of getDetailedRepoStateAsync.

Impacted documentation

The API doc for @rushstack/package-deps-hash, API for IInputsSnapshot in rush-lib.

@dmichon-msft dmichon-msft enabled auto-merge (squash) May 7, 2025 22:02
@dmichon-msft dmichon-msft merged commit 82bd3db into microsoft:main May 7, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Needs triage to Closed in Bug Triage May 7, 2025
@dmichon-msft dmichon-msft deleted the snapshot-local branch May 7, 2025 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

2 participants